<?php

Raise::load('RaiseDateTimeComponentComparator');

class RaiseDateComparator extends RaiseDateTimeComponentComparator {
    
    /**
     * Compares two RaiseDate objects
     * @param RaiseDate $date1 First time to compare
     * @param RaiseDate $date2 Second time to compare
     * @return integer Return 0 if both date are equal, 1 if $date2 > $date1 and -1 if $date2 < $date1
     */
    public function compare($date1, $date2) {
        $components = array('year', 'month', 'day');
        return $this->compareComponents($date1, $date2, $components);
    }
    
}